<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    27-lug-2012
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
    //<![CDATA[
    google.load("maps","3.8", {"other_params":"sensor=true"});
      
    $(document).ready(function()
    {
//        var rendererOptions = {
//            draggable: true
//        };
//        var container = $('div.map-frame').get(0);
//        
//        var directionsService = new google.maps.DirectionsService();
//        var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);
//        var map;
//
//        
//        var chicago = new google.maps.LatLng(41.850033, -87.6500523);
//        var mapOptions = {
//            zoom:7,
//            mapTypeId: google.maps.MapTypeId.ROADMAP
//        }
//        map = new google.maps.Map(container, mapOptions);
//        directionsDisplay.setMap(map);
//        directionsDisplay.setPanel(document.getElementById("directionsPanel"));
//        
//        var start = 'via sebastiano serlio 25/2, Bologna, IT';
//        var end = 'Milano, IT';
//        var request = {
//            origin:start,
//            destination:end,
//            travelMode: google.maps.TravelMode.DRIVING
//        };
//        directionsService.route(request, function(result, status) {
//            if (status == google.maps.DirectionsStatus.OK) {
//                directionsDisplay.setDirections(result);
//            }
//        });

        $('tr[class^="tourbook-step"]').click(function(){
            $(this).siblings().removeClass('focused');
            $(this).toggleClass('focused');
        })  
    });

    //]]>
</script>
<div class="info">
    ...
</div>
<div id="content">
    <div id="summary" class="tourbook">
	<div class="head">
	    <h2>Tourbook</h2>
	</div>
	<div class="body">
            <table cellspacing="0" class="table">
                <tbody>
                    <tr>
                        <td>Evento:</td>
                        <td>
                            <strong>
                            <?php echo $this->data['event']['event_title']; ?>
                            </strong>
                        </td>
                    </tr>
                    <tr>
                        <td>Tipo:</td>
                        <td>
                            <strong>
                            <?php echo $this->event_types[$this->data['event']['event_type']]['event_type_name']; ?>
                            </strong>
                        </td>
                    </tr>
                </tbody>
            </table>            
        </div>
    </div>    
    <div class="help">
	<h2>Aiuto:</h2>
	<br/>
        Qui puoi compilare e stampare il Tourbook degli eventi
    </div>
    <?php 
    list( $y, $m, $d ) = explode( '-', $this->data['live']['live_date'] );
    ?>
    <table cellspacing="0" class="list tourbook" id="live-list">
        <tbody>
            <tr class="tourbook-step">
		<td class="date">
		    <h3>
			<b><?php echo $d ?> <?php echo $this->months[sprintf( '%01d', $m )] ?> <?php echo $y ?></b>
			<span><?php echo $this->days[date( 'N', mktime( $hour, $minute, $second, $m, $d, $y ) )] ?></span>
		    </h3>		
		</td>
		<td class="artists">
                    <?php echo $this->data['live']['location']['location_name'] ?>, <strong><?php echo $this->data['live']['location']['location_city'] ?></strong> (<?php echo $this->province[$this->data['live']['location']['location_province_id']]['province_short_name'] ?>)
                
                <?php 
                if( count( $this->data['live']['artists']['openingact'] ) > 0 ):
                    foreach( $this->data['live']['artists']['openingact'] as $artist ):  
                        $openingact_artists .= $artist['artist_name'] .', ';
                    endforeach; 
                ?>
                <br/> 
                + <span><?php echo substr( $openingact_artists, 0, -2 ) ?></span>
                <?php endif; ?>
		</td>
		<td class="live-status">
                    <div class="live-status editable">
                        <div class="live-actions" id="<?php echo $this->data['live']['live_id'] ?>">
                            <span class="<?php echo $this->live_status[$this->data['live']['live_status_id']]['live_status_mark'] ?>">
                                <?php echo $this->live_status[$this->data['live']['live_status_id']]['live_status_name'] ?>
                            </span>
                        </div>
                    </div>
		</td>
	    </tr>
            
            <tr>
                <td colspan="5">
                    <div class="map-frame">
                         Mappa 
                    </div>
                    <div id="directionsPanel" style="float:right;width:30%;height: 100%"></div>
                </td>
            </tr>
        </tbody>
    </table>

</div>